<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="stylesheet" href="<%=request.getContextPath()%>/style/style.css" type="text/css"/>
        <title>byAMFI - Products</title>
    </head>
    <body id="bodyManagement">

        <div id="managementMenu">
            <a class="managementLink" href="../category/overview">CATEGORIES</a>  
            |  <a class="managementLink" href="../products/overview">PRODUCTS</a>
            |  <a class="managementLink" href="../brand/overview" style="font-size: 17px;"><b>BRANDS</b></a>
        </div>

        <div id="overview">

            <c:choose>

                <c:when test="${amountOfBrands != 0}">

                    <table>

                        <!--Wanneer er gebruikers opgeslagen zijn, worden ze hier getoond--> 
                        <c:forEach var="tempBrand" items="${brandList}">
                            <tr>
                                <td>
                                    <p style="text-align: center;"> ${tempBrand.brand_name}</p>
                                </td>

                                <td>
                                    <img src="<%=request.getContextPath()%>/brand/uploads/${tempBrand.brand_image}"/>
                                </td>

                                <td>
                                    <a href="edit?brandid=${tempBrand.brand_id}">
                                        <img src="../../style/images/button_edit.png" width="20" height="20" />
                                    </a>

                                    <a href="javascript:if(confirm('Are you sure you want to delete this brand?'))window.location='${url}delete?id=${tempBrand.brand_id}';" class="icon delete">
                                        <img src="../../style/images/button_remove.png" width="20" height="20" />
                                    </a>
                                </td>
                            </tr>
                        </c:forEach>


                    </table>
                </c:when>

                <c:otherwise>
                    <!-- Als er geen gebruikers zijn, wordt deze melding getoond -->
                    <div class="errormessage">
                        <p>No brands found.</p>
                    </div>
                </c:otherwise>

            </c:choose>

        </div><!-- total wrapper close -->

        <div id="centeredButton">

            <a href="../brand/new">
                <img src="../../style/images/button_newBrand.png" width="110" height="30"/>
            </a>

        </div>

    </body>
</html>
